<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="spring" uri="/WEB-INF/spring.tld"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
  String info = (String)request.getAttribute("alert");
  if(null == info)
     info = "";
  String userName = (String)request.getAttribute("username");
  if(null == userName)
     userName = "";
  session.invalidate();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<base href="<%=basePath%>">
<title><spring:message code="sys.name" /></title>
<SCRIPT language=JavaScript type=text/JavaScript>
<!--
if(self != top) top.location.href = window.location.href;
//-->
function checkform()
{
if(isNull(document.LoginForm.UserName.value)){
  alert("请输入用户名～！");
  document.all.UserName.focus();
  return false;
}
if(isNull(document.LoginForm.Password.value)){
  alert("请输入密码～！");
  document.all.Password.focus();
  return false;
}
return true;
}
function isNull(pvalue)
 {
   var RegularExp=/^\s*$/;
   if(RegularExp.test(pvalue))
   {
     return true;
   }
   return false;
 }
function submitPage(){ 
    var LoginForm = document.forms[0];
    if(checkform()){
       LoginForm.submit();
    }
	
}
function isEntry(e){
     if(document.all)e = event;
     if(e.keyCode==13) {
             submitPage();
     };
}
</script>
<link rel="stylesheet" type="text/css" href="<%=basePath %>app/css/layout.css"/>
<script src="<%=basePath %>app/javascripts/jquery-1.5.1.js"></script>
<script src="<%=basePath %>app/javascripts/layout.js"></script>
</head>
<body class="login_bg">
	<div class="login_parent">
    <form name="LoginForm" action="<%=basePath %>logon.do"  method="post">
    	<p>
        	用户名<input name="UserName" type="text" class="name" value="<%=userName %>"/><br />
        	密　码<input name="Password" type="password" onkeydown="isEntry(event)" class="pass"/><br />
        	<span><font color=red><strong><%=info%></strong></font></span> 
        </p>
        <p>
        	<input type="button" onclick="javaScript:submitPage(); return false"   class="login"/><!-- input name="" type="button" class="regis"/-->
        </p>
    </form>
    </div>
    <div class="copy_right"><spring:message code="sys.copyright" /></div>
</body>
</html>
